/**
 *  转换ant table的sorter对象转换成分页的查询的排序字段
 * @param {object} sorter
 */
export const conventSorter = sorter => {
    const option = {};
    if(sorter)
        // 点击排序
        if(sorter.order && sorter.field) {
            option.sortField = sorter.field;
            if(sorter.order === 'descend')
                option.isDesc = true;
            else
                option.isDesc = false;
        } else { // 取消排序
            option.sortField = undefined;
            option.isDesc = undefined;
        }
    return option;
};
